<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    localStorage.setItem('sitename', '菜鸟教程')
    console.log(localStorage.getItem('sitename'))
    var arr = [
      {
        name: '张三',
        age: '18',
        sex: [
          {
            nan: 1,
            nv: 2,
          },
        ],
      },
      {
        name: '李四',
        age: '16',
        sex: [
          {
            nan: 1,
            nv: 2,
          },
        ],
      },
    ]
    // localStorage.setItem('user', JSON.stringify(arr))
    // console.log(JSON.parse(localStorage.getItem('user')))
    // localStorage.removeItem('sitename')
    // console.log(localStorage.key(1))
    // localStorage.clear()

    // sessionStorage.setItem('data', JSON.stringify(arr))
    // console.log(JSON.parse(sessionStorage.getItem('data')))
  </script>
</html>
